package com.ds.infrastructure.hyperspace.container.endpoint.connector;

import com.ds.infrastructure.hyperspace.common.EndpointNode;
import com.ds.infrastructure.hyperspace.common.EndpointProtocolEnum;
import com.ds.infrastructure.hyperspace.common.TargetEndpointStream;
import com.ds.infrastructure.hyperspace.common.TargetEndpointStreamStatus;
import com.ds.infrastructure.hyperspace.common.config.TargetNodeConfig;
import com.ds.infrastructure.hyperspace.common.flow.DuplexFlowContext;

/**
 * @author  Weishaoying
 */
public class EmptyTargetEndpointStream implements TargetEndpointStream, Timeoutable {

    private final TargetEndpointStreamStatus status;

    public EmptyTargetEndpointStream(TargetEndpointStreamStatus status) {
        this.status = status;
    }

    @Override
    public EndpointNode<TargetNodeConfig> getTargetEndpointNode() {
        return null;
    }

    @Override
    public void connect() {
        // no need implements
    }

    @Override
    public TargetEndpointStreamStatus getStatus() {
        return status;
    }

    @Override
    public <C extends DuplexFlowContext> void handleInput(C duplexFlowContext, Object data) {
        // no need implements
    }

    @Override
    public <C extends DuplexFlowContext> void handleInputComplete(C duplexFlowContext) {
        // no need implements
    }

    @Override
    public void onTargetChannelClose() {
        // no need implements
    }

    @Override
    public void changeTargetChannelReadable(boolean readable) {
        // no need implements
    }

    @Override
    public void closeTargetChannel() {
        // no need implements
    }

    @Override
    public <C extends DuplexFlowContext> void switchProtocol(C duplexFlowContext,
            EndpointProtocolEnum protocol) {
        // no need implements
    }

    @Override
    public boolean isAvailableTargetNode() {
        return true;
    }

    @Override
    public void clearSuspendRequest() {
        // no need implements
    }

    @Override
    public void noticeEntryChannelClosed() {

    }

    @Override
    public String getEventId() {
        return null;
    }

    @Override
    public boolean checkTimeout() {
        return false;
    }

    @Override
    public void onTimeout() {
        // no need implements
    }

    @Override
    public void touch() {
        // no need implements
    }
}
